<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<!-- 引入head中公共部分 -->
<head th:replace="header::header-commo(我的购物车)"></head>

<body>
<!-- 引入头部导航-->
<header th:replace="header::header-nav"></header>
		<!--
        	
        -->
		<div class="container" style="margin-top:25px;">
			<div th:if="${session.cart==null}" class="jumbotron">
					  <p class="text-center">
					  您的购物车中还没有商品,
					  <a class="" th:href="@{/}" href="${pageContext.request.contextPath}/"> 去逛逛吧</a>
					  </p>
			 </div>
			<!--/*@thymesVar id="cart" type="com.gitee.shop.domain.Cart"*/-->
			<div th:if="${session.cart!=null}" class="panel panel-success">
				<!-- Default panel contents -->
				<div class="panel-heading">
					<h3 class="panel-title">我的购物车</h3>
				</div>
				<!-- Table -->
				<table class="table table-condensed text-center table-responsive">
					<thead>
						<tr>
							<th class="text-center">图片</th>
							<th class="text-center">商品</th>
							<th class="text-center">单价(元)</th>
							<th class="text-center">数量</th>
							<th class="text-center">小计</th>
							<th class="text-center">操作</th>
						</tr>
					</thead>
					<tbody>
						<tr th:each="entry:${session.cart.cartItems}">
							<td><img th:src="@{'/upload/'+${entry.value.item.image}}" src="img/goods1.jpg" class="buyimg" /></td>
							<td th:text="${entry.value.item.name}">提莫 手办</td>
							<td th:text="'¥'+${entry.value.item.shopPrice}">¥150.00</td>
							<td style="vertical-align: middle">
								<div class=" input-group col-md-3 " style="margin:  0 auto;">
									<span class="input-group-addon">-</span>
									<input name="count" type="text" th:value="${entry.value.count}" class="form-control text-center" value="1">
									<span class="input-group-addon">+</span>
								</div>
							</td>
							<td th:text="'¥'+${entry.value.subtotal}">¥150.00</td>
							<td>
								<a href="#">删除</a>
							</td>
						</tr>

					</tbody>
				</table>
			</div>
			<div th:if="${session.cart!=null}" class="text-right">
				商品金额：<span class="xiangq_font3" th:text="'¥'+${session.cart.total}">¥350.00元</span>
			</div>
			<div class="text-right" style="border-bottom: 1px solid #DDDDDD;border-top: 1px solid #DDDDDD; margin-top: 10px;padding:5px 0 5px 0;">
				<a th:href="@{/cart/clear}" class="btn  btn-danger btn-lg"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span>清空购物车</a>
				<a class="btn  btn-success btn-lg" th:href="@{/order/create}" href="#" role="button">提交订单</a>
			</div>
		</div>

		<!--
        	作者：offline
        	描述：底部
        -->
<!--底部-->
<footer th:replace="footer::footer-commo"></footer>
</body>
</html>